-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Add doi-to-bibtex to examples and JabKit #14244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
I tried running it with a valid and an completely invalid doi Unmatched argument at index 2: '1abref'
Usage: jabkit doi-to-bibtex DOI...
Converts a DOI to BibTeX
DOI... one or more DOIs to fetchBut I would say it should not completely "crash" but print out the valid one and for the second the |
subhramit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Micro comments - I am committed to not letting vars enter again - so keeping them only in the example file
|
|
||
| @Override | ||
| public Integer call() { | ||
| var fetcher = new CrossRef(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| var fetcher = new CrossRef(); | |
| CrossRef fetcher = new CrossRef(); |
| try (var writer = new OutputStreamWriter(System.out, StandardCharsets.UTF_8)) { | ||
| var context = new BibDatabaseContext(new BibDatabase(entries)); | ||
| var bibWriter = new BibDatabaseWriter(writer, context, argumentProcessor.cliPreferences); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| try (var writer = new OutputStreamWriter(System.out, StandardCharsets.UTF_8)) { | |
| var context = new BibDatabaseContext(new BibDatabase(entries)); | |
| var bibWriter = new BibDatabaseWriter(writer, context, argumentProcessor.cliPreferences); | |
| try (OutputStreamWriter writer = new OutputStreamWriter(System.out, StandardCharsets.UTF_8)) { | |
| BibDatabaseContext context = new BibDatabaseContext(new BibDatabase(entries)); | |
| BibDatabaseWriter bibWriter = new BibDatabaseWriter(writer, context, argumentProcessor.cliPreferences); |
|
And maybe also a option which disables the error messages but still returns exit code 1, so if you want to work with the output and ignore errors for example. Can't name a case for that, but i can imagine that it could be helpful. But one could probably just read the out and ignore err output and achieve it without the extra option |
Strongly demanded by the community. Was available inside JabRef; now we can offer as CLI.
Kind of follow-up to #14233.
We use CrossRef
Steps to test
Create and modify debug configuration for
org.jabref.JabKit#mainMandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)